package entity

import "time"

type Yml struct {
	App      App      `yaml:"app"`
	Etcd     Etcd     `yaml:"etcd"`
	Mq       MQ       `yaml:"mq"`
	Es       ES       `yaml:"es"`
	Email    Email    `yaml:"email"`
	LogFiles []string `yaml:"logfiles"`
}

type App struct {
	Name string `yaml:"name"`
	Port string `yaml:"port"`
	Role string `yaml:"role"`
	Log  Log    `yaml:"log"`
}

type Log struct {
	Info     string `yaml:"info"`
	Error    string `yaml:"error"`
	Debug    string `yaml:"debug"`
	Warn string `yaml:"warn"`
}

type Etcd struct {
	Host   string `yaml:"host"`
	Port   string `yaml:"port"`
	Prefix string `yaml:"prefix"`
}

type MQ struct {
	Host              string        `yaml:"host"`
	Port              string        `yaml:"port"`
	Username          string        `yaml:"username"`
	Password          string        `yaml:"password"`
	MaxReconnectNum   int           `yaml:"max_reconnect_num"`
	WaitReconnectTime time.Duration `yaml:"wait_reconnect_time"`
}

type ES struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Email struct {
	// ServerHost 邮箱服务器地址，如腾讯企业邮箱为smtp.exmail.qq.com
	ServerHost string `yaml:"server_host"`
	// ServerPort 邮箱服务器端口，如腾讯企业邮箱为465
	ServerPort string `yaml:"server_port"`
	// UserName　发件人邮箱地址
	UserName string `yaml:"username"`
	// Password 发件人邮箱密码（注意，这里是明文形式）
	Password string `yaml:"password"`
	// Toers 接收者邮件，如有多个，则以英文逗号(“,”)隔开，不能为空
	Toers []string `yaml:"toers"`
}
